//
// Created by 束庆乐 on 2024/12/28.
//
/**
* 多级指针
*/

#include <stdio.h>

int main(){
    int a[] = {1,2,3};
    int b[] = {4,5,6};
    int c[] = {7,8,9};
    int* arr[] = {a,b,c};
    int **m = arr;//二维数组用二级指针表示
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
//            printf("%d ",arr[i][j]);//方法1
//            printf("%d ",*(arr[i]+j));//方法2
//            printf("%d ",*(*(arr+i)+j));//方法3
            printf("%d ",*(*(m+i)+j));//方法4
        }
        printf("\n");
    }
    int s = 10;
    int *p = &s;
    printf("s==%d\n",s);//10
    printf("*p==%d\n",*p);//10
    int **q = &p;
    printf("**q ==%d\n ",**q);//10,*是取地址符号q是二级地址，然后*q取二级地址存储的值即一级地址，**q就是取一级地址存储的值



    return 0;
}